Skip to content

ci: skip claude.yml when comment is '@claude review'#2337

Merged
felixweinberger merged 1 commit intomainfrom
fweinberger/exclude-claude-review-from-gha
Mar 24, 2026
Merged

ci: skip claude.yml when comment is '@claude review'#2337
felixweinberger merged 1 commit intomainfrom
fweinberger/exclude-claude-review-from-gha

Conversation

@felixweinberger
Copy link
Copy Markdown
Contributor

Excludes @claude review comments from triggering this workflow.

Motivation and Context

Comments starting with @claude review are handled by the hosted code-review webhook, which creates a dedicated "Claude Code Review" check run. When this GitHub Action also fires on the same comment, both systems respond — the GHA run then fails on fork PRs because it tries to fetch the fork branch from origin, leaving a red ❌ on the PR alongside the actual (successful) review.

How Has This Been Tested?

Observed the double-trigger on typescript-sdk PR #1003: @claude review fired both the hosted webhook (check run started correctly) and the equivalent claude.yml workflow (failed with git fetch origin <fork-branch>). Same workflow file here.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Only the issue_comment event is excluded since that's the only event type the hosted webhook listens to. @claude review in a PR review comment or issue body still triggers this workflow as before.

Mirror of modelcontextprotocol/typescript-sdk#1737.

Comments starting with '@claude review' are handled by the hosted
code-review webhook, which creates a dedicated check run. Running this
workflow on the same trigger causes both systems to respond to one
comment — the GHA run then fails on fork PRs because it tries to fetch
the fork branch from origin.
@felixweinberger felixweinberger force-pushed the fweinberger/exclude-claude-review-from-gha branch from e0d7857 to 18623f0 Compare March 24, 2026 20:31
@felixweinberger felixweinberger enabled auto-merge (squash) March 24, 2026 20:33
Copy link
Copy Markdown
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — straightforward CI condition fix to avoid double-triggering on @claude review comments.

Extended reasoning...

Overview

This PR modifies a single GitHub Actions workflow file (.github/workflows/claude.yml) to add a !startsWith guard to the issue_comment event condition. This prevents the workflow from firing when the hosted code-review webhook already handles the same comment.

Security risks

None. The change only narrows when a CI workflow triggers — it does not touch application code, secrets, permissions, or authentication logic.

Level of scrutiny

Minimal scrutiny is appropriate. This is a one-line conditional change in a CI workflow file, mirroring an equivalent change already landed in the TypeScript SDK. The logic is simple and the intent is clear from the PR description.

Other factors

No bugs were found. No prior reviews exist on this PR. The change is self-contained, non-breaking, and well-motivated by the observed double-trigger behavior on fork PRs.

@felixweinberger felixweinberger merged commit 7ba4fb8 into main Mar 24, 2026
31 of 32 checks passed
@felixweinberger felixweinberger deleted the fweinberger/exclude-claude-review-from-gha branch March 24, 2026 20:36
Copy link
Copy Markdown
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, straightforward CI condition to avoid double-triggering on @claude review comments.

Extended reasoning...

Overview

This PR modifies a single line in .github/workflows/claude.yml, adding a !startsWith guard to the issue_comment condition. This prevents the GitHub Action from firing when the hosted code-review webhook already handles @claude review comments.

Security risks

None. The change only narrows the set of comments that trigger the workflow. It does not grant new permissions, expose secrets, or modify any runtime behavior.

Level of scrutiny

Minimal scrutiny needed. This is a one-line CI config tweak that filters out a specific comment pattern. The logic is simple and the intent is clearly explained in the PR description with a concrete example of the double-trigger problem.

Other factors

No bugs were found. No outstanding reviewer comments. The change mirrors an equivalent fix already applied to the TypeScript SDK. The modification is self-contained and easily reversible.

maxisbey added a commit that referenced this pull request Mar 27, 2026
CCR now handles code review on this repo (since ~2026-03-08), making
this workflow redundant. The workflow has been running on every PR push
but cannot post reviews due to read-only pull-requests permissions, so
it was consuming compute without producing visible output.

The claude.yml workflow for @claude mentions is retained. #2337 already
added the '@claude review' exclusion guard so it does not overlap with
CCR.

Matches typescript-sdk#1754.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants